<?php
require_once("includes/discuss.tbl.php");
require_once("viewinfo.php");

$id = $_REQUEST["id"];
if($id > 0)
{
	$pClsDiscuss = new clsDiscussTable($id);
	$title = $pClsDiscuss->value('title');
	$content = $pClsDiscuss->value('content');
	$listdiscuss = $pClsDiscuss->listobj(10);
	$arr_link = array();
	foreach($listdiscuss as $pClsDiscuss)
	{
		if($pClsDiscuss->value('id') != $id)
		{
			$arr_link[$pClsDiscuss->value('title')] = "?page=discuss&id=".$pClsDiscuss->value('id');
		}
	}
	view_info1($title, $content, "Các các bản tin khác", $arr_link );
}
else
{
	$title = "Cha mẹ nên biết";
	$pClsDiscuss = new clsDiscussTable();
	$listdiscuss = $pClsDiscuss->listobj(10);
	view_list_discuss($title, $listdiscuss);
}	
?>